from setuptools import setup, find_packages
import os

# Function to read the requirements.txt file
def read_requirements():
    requirements_path = os.path.join(os.path.dirname(__file__), 'requirements.txt')
    if os.path.exists(requirements_path):
        with open(requirements_path, 'r', encoding='utf-8') as f:
            return [line.strip() for line in f if line.strip() and not line.startswith('#')]
    return []

# Function to read the README.md file for long description
def read_readme():
    readme_path = os.path.join(os.path.dirname(__file__), 'README.md')
    if os.path.exists(readme_path):
        with open(readme_path, 'r', encoding='utf-8') as f:
            return f.read()
    return 'Secure Configuration Manager with CLI and Web UI'

setup(
    name='secure-config-manager',
    version='1.0.5', 
    author='balabalaABCD / 至灵交易工作室',
    author_email='bettertrade@qq.com', # 无效邮箱
    description='A tool to securely manage configuration files with encryption, CLI, and Web UI.',
    long_description=read_readme(),
    long_description_content_type='text/markdown',
    url='https://gitee.com/mangochan/quant-hub-cfg-manager',
    packages=find_packages(exclude=['tests*', 'docs*']),
    include_package_data=True, 
    install_requires=read_requirements(),
    python_requires='>=3.8',
    entry_points={
        'console_scripts': [
            # 'secureconfig = secure_config_manager.cli_safety:main', # 创建只读命令工具
            'secureconfig = secure_config_manager.cli:main', # 创建完整命令工具
        ],
    },
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Topic :: Security',
        'Topic :: Utilities',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
        'Programming Language :: Python :: 3.11',
        'Operating System :: OS Independent',
    ],
    keywords='configuration management security encryption cli webui',
)